/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.eurotrader.entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Edmilson
 */
@Entity
@Table(name = "ordemdeservico_has_equipamento_has_tempo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "OrdemdeservicoHasEquipamentoHasTempo.findAll", query = "SELECT o FROM OrdemdeservicoHasEquipamentoHasTempo o"),
    @NamedQuery(name = "OrdemdeservicoHasEquipamentoHasTempo.findByDataHoraPausa", query = "SELECT o FROM OrdemdeservicoHasEquipamentoHasTempo o WHERE o.dataHoraPausa = :dataHoraPausa"),
    @NamedQuery(name = "OrdemdeservicoHasEquipamentoHasTempo.findByDataHoraInicio", query = "SELECT o FROM OrdemdeservicoHasEquipamentoHasTempo o WHERE o.dataHoraInicio = :dataHoraInicio"),
    @NamedQuery(name = "OrdemdeservicoHasEquipamentoHasTempo.findById", query = "SELECT o FROM OrdemdeservicoHasEquipamentoHasTempo o WHERE o.id = :id")})
public class OrdemdeservicoHasEquipamentoHasTempo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Basic(optional = false)
    @NotNull
    @Column(name = "dataHoraPausa")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dataHoraPausa;
    @Basic(optional = false)
    @NotNull
    @Column(name = "dataHoraInicio")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dataHoraInicio;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @JoinColumn(name = "equipamento_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Equipamento equipamentoId;
    @JoinColumn(name = "ordemdeservico_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Ordemdeservico ordemdeservicoId;

    public OrdemdeservicoHasEquipamentoHasTempo() {
    }

    public OrdemdeservicoHasEquipamentoHasTempo(Integer id) {
        this.id = id;
    }

    public OrdemdeservicoHasEquipamentoHasTempo(Integer id, Date dataHoraPausa, Date dataHoraInicio) {
        this.id = id;
        this.dataHoraPausa = dataHoraPausa;
        this.dataHoraInicio = dataHoraInicio;
    }

    public Date getDataHoraPausa() {
        return dataHoraPausa;
    }

    public void setDataHoraPausa(Date dataHoraPausa) {
        this.dataHoraPausa = dataHoraPausa;
    }

    public Date getDataHoraInicio() {
        return dataHoraInicio;
    }

    public void setDataHoraInicio(Date dataHoraInicio) {
        this.dataHoraInicio = dataHoraInicio;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Equipamento getEquipamentoId() {
        return equipamentoId;
    }

    public void setEquipamentoId(Equipamento equipamentoId) {
        this.equipamentoId = equipamentoId;
    }

    public Ordemdeservico getOrdemdeservicoId() {
        return ordemdeservicoId;
    }

    public void setOrdemdeservicoId(Ordemdeservico ordemdeservicoId) {
        this.ordemdeservicoId = ordemdeservicoId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof OrdemdeservicoHasEquipamentoHasTempo)) {
            return false;
        }
        OrdemdeservicoHasEquipamentoHasTempo other = (OrdemdeservicoHasEquipamentoHasTempo) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.eurotrader.entidades.OrdemdeservicoHasEquipamentoHasTempo[ id=" + id + " ]";
    }
    
}
